package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.dto.ReservationDTO;
import com.zzyl.nursing.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

import com.zzyl.nursing.domain.Reservation;
import org.apache.ibatis.annotations.Select;

/**
 * 预约信息Mapper接口
 *
 * @author ruoyi
 * @date 2025-06-09
 */
@Mapper
public interface MemberReservationMapper extends BaseMapper<Reservation> {


    //获取预约数量
    @Select("select time, 6 - COUNT(*) as count from reservation where  status != 2 group by #{timeNow}")
    List<TimeCountVo> getCountByTime(LocalDateTime timeNow);

    //添加预约
    void addReservation(Reservation reservation);

    //查询预约列表
    List<Reservation> selectReservationList(ReservationDTO reservationDTO);

    //更新预约
    void updateReservation();
}
